package info.techgeek.labs.exception;

public class FinallyDemo {
	// Through an exception out of the method.
	static boolean procA() {
		try {
			System.out.println("inside try1");
			throw new RuntimeException("demo");
		} catch (Exception e){ 
			System.out.println("Catch Block 1");
//			return  true;
			try {
				System.out.println("inside Try2 ");
				throw new RuntimeException("demo");
			} catch (Exception ex){
				System.out.println("Catch Block 2");
				return false;
			}
		} finally {
			System.out.println("procA's finally");
		}
	}
	
	public static void main(String[] args) {
		
//		try {
//			System.out.println("inside procA");
//			throw new RuntimeException("demo");
//		} catch (Exception e){ 
//			System.out.println("Catch Block finally");
//		}
//		finally {
//			System.out.println("procA's finally");
//		}
		
		System.out.println(FinallyDemo.procA());
		
	}
}
